import {Routes} from '@angular/router';
import {IndexComponent} from './index/index.component';
import {LayoutComponent} from '../layout/layout.component';
import {MasterGuard} from './master.guard';

export const masterRoutes: Routes = [
  {
    path: '',
    component: LayoutComponent,
    canActivate: [MasterGuard],
    children: [
      {path: '', redirectTo: 'index', pathMatch: 'full'},
      {path: 'index', component: IndexComponent},
      {path: 'a', loadChildren: './a/a.module#AModule'},
      {path: 'b', loadChildren: './b/b.module#BModule'},
      {path: 'c', loadChildren: './c/c.module#CModule'},
      {path: '**', redirectTo: 'index'}
    ]
  }
];
